package com.wzx.service.impl;

import com.wzx.domain.User;
import com.wzx.service.IUser;
import org.springframework.stereotype.Component;

import java.util.List;

//2 类与接口是实现关系
@Component
public class UserImpl implements IUser {
    //连接点
    //切点
    @Override
    public void work() {
        System.out.println("我加班我快乐");
    }

    @Override
    public boolean play() {
        System.out.println("专心 狠狠的玩");
        return true;
    }

    @Override
    public void add(User user) {
        System.out.println("add ...");
    }

    @Override
    public User update(User user) {
        System.out.println("update ...");
        return null;
    }

    @Override
    public void deleteById(Integer id) {
        System.out.println("deleteById ...");
        System.out.println(1/0);
    }

    @Override
    public List<User> findByName(String name) {
        System.out.println("findByName ...");
        return null;
    }

    @Override
    public void batchAdd(List<User> list) {
        System.out.println("batchAdd ...");
    }
}
